<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use App\Menu;
use Illuminate\Database\Eloquent\SoftDeletes;
class Role extends Model
{
    use SoftDeletes;
    protected $guarded=[];
    protected $appends=['menus'];
    
    public function getMenusAttribute(){
        $menus=Menu::whereIn('id',explode(',',$this->menu_ids))->get();
        return $menus;
    }
}
